const http = require('../utils/http')

const HTTP = new http.HTTP()

// 获取首页海报
export function getBanners(callback) {
  let params = {}
  HTTP.request('/poster/list', 'GET', params, res => {
    callback(res)
  })
}

// 获取志愿者总数
export function getVolunteerTotal(callback) {
  let params = {}
  HTTP.request('/volunteer/counts', 'GET', params, res => {
    callback(res)
  })
}

// 获取社团总数
export function getCommunityTotal(callback) {
  let params = {}
  HTTP.request('/community/counts', 'GET', params, res => {
    callback(res)
  })
}

// 获取活动总数
export function getActivityTotal(callback) {
  let params = {}
  HTTP.request('/activity/counts', 'GET', params, res => {
    callback(res)
  })
}

// 获取热门活动
export function getHotActivity(callback) {
  let params = {}
  HTTP.request('/hotActivity/list', 'GET', params, res => {
    callback(res)
  })
}

// 获取openid
export function getOpenid(code, usertype, callback) {
  let params = {
    code,
    usertype
  }
  HTTP.request('/login/wechat', 'POST', params, res => {
    callback(res)
  })
}